package com.hmy.infrastructure.api.client.corpsearch;

import com.hmy.ccp.common.result.FeignResult;
import com.hmy.infrastructure.api.bo.request.corpsearch.CorpDetailSearchRequest;
import com.hmy.infrastructure.api.bo.request.corpsearch.CorpSearchRequest;
import com.hmy.infrastructure.api.bo.response.corpsearch.CorpDetailClientResponse;
import com.hmy.infrastructure.api.bo.response.corpsearch.CorpSearchResponse;
import com.hmy.infrastructure.api.fallback.corpsearch.CorpSearchFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 企业信息三方数据查询
 *
 * @author songkf
 */
@FeignClient(value = "hmy-ccp-infrastructure", fallback = CorpSearchFeignClientFallback.class)
public interface CorpSearchFeignClient {
    /**
     * 根据企业名称进行企业列表查询（模糊匹配）
     *
     * @param corpSearchRequest {@link CorpSearchRequest} 企业集合模糊查询参数
     * @return {@link CorpSearchResponse} 企业模糊查询集合
     * @author songkf
     */
    @PostMapping("/feign/corp-search/list")
    FeignResult<CorpSearchResponse> corpListSearch(@Validated @RequestBody CorpSearchRequest corpSearchRequest);

    /**
     * 根据企业全称从三方查询工商详细信息
     *
     * @param detailSearchRequest {@link CorpDetailSearchRequest} 企业工商详细信息查询参数
     * @return {@link CorpDetailClientResponse} 企业工商详细信息
     * @author songkf
     */
    @PostMapping("/feign/corp-search/detail")
    FeignResult<CorpDetailClientResponse> corpDetailSearch(@Validated @RequestBody CorpDetailSearchRequest detailSearchRequest);
}
